extends TextureRect

var rotation_speed = PI

func _ready() -> void:
	set_visibility_layer(101)
	set_process(false)
	Utils.on_game_start.connect(self.on_game_start)
	on_game_start()
	
func on_game_start():
	set_process(true)
	Input.mouse_mode = Input.MOUSE_MODE_CONFINED_HIDDEN
	
func _process(delta: float) -> void:
	rotation += rotation_speed * delta
	global_position = get_global_mouse_position()
	#global_position = get_global_mouse_position() - size  / 8
	
func _notification(what: int) -> void:
	if what == NOTIFICATION_PAUSED:
		visible = false
		Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
	if what == NOTIFICATION_UNPAUSED:
		visible = true
		Input.mouse_mode = Input.MOUSE_MODE_CONFINED_HIDDEN
